/*
 * @file quaternion.h 
 * @brief quaternion class, it is used for rotation operations.
 * @author Sheng Yang, Fei Zhu
 * 
 * This file is part of Physika, a versatile physics simulation library.
 * Copyright (C) 2013- Physika Group.
 *
 * This Source Code Form is subject to the terms of the GNU General Public License v2.0. 
 * If a copy of the GPL was not distributed with this file, you can obtain one at:
 * http://www.gnu.org/licenses/gpl-2.0.html
 *
 */
#pragma once
#include <glm/glm.hpp>

namespace PhysLeo{

/**
 * quaternion implementation
 */
class Quaternion
{
public:    
    /* Constructors */
    explicit Quaternion(float x, float y, float z, float w);
    explicit Quaternion(const glm::vec3 &unit_axis, float angle_rad);  //init from the rotation axis and angle(in radian)

    glm::vec3 rotate(const glm::vec3& v ) const;    // rotates passed vec by this;

protected:
    float x_,y_,z_,w_;
};

}//end of namespace Physika
